﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpaceSquirrel.Automation
{
	public class SeedAutomation : SpriteAutomation
	{
		private bool used = false;

		public SeedAutomation(Sprite sprite)
			: base(sprite)
		{ }

		public override void DoStuff(PlayScene scene)
		{
			Sprite p = scene.Player;
			int dx = p.x - this.sprite.x;
			int dy = p.y - this.sprite.y;
			if (dx * dx + dy * dy < 100 && !this.used)
			{
				this.sprite.dead = true;
				this.used = true;
				((SpaceSquirrel.SpecialLevelStuff.BirdFeeder)scene.special[0]).seedsLeft--;
				SoundManager.PlayNoise("raise_health"); // TODO: change this to collect_seed but keep sound the same.
			}
		}
	}
}
